//////////////////////////////////////////////////////////////////////////
#pragma once
//////////////////////////////////////////////////////////////////////////
#include "CompositeObject/CompositeObject.h"
#include <map>
#include <string>
#include "Functor/Functor.h"
//////////////////////////////////////////////////////////////////////////
class Sprite;
class HotSpot;
//////////////////////////////////////////////////////////////////////////
class Button: public CompositeObject
{
public:
	Button();
	virtual ~Button();

	void		 setSprites(const wchar_t* passive, const wchar_t* active = NULL, 
							const wchar_t* press = NULL, const wchar_t* disable = NULL);
	bool		 onMouseEvent(bool isDown);
	bool		 onMouseEnter();
	bool		 onMoudeLeave();
	void		 setCenterAlign();
	void		 setClickCb(Functor<void>* functor){m_ClickCb = functor;};

private:		
	void		 selectSprite(const wchar_t* name);
	void		 setupHotSpot();

private:
	std::map<std::wstring, Sprite*>  m_Sprites;
	HotSpot*						 m_hotSpot;
	bool							 m_Pressed;
	Functor<void>*					 m_ClickCb;
};
//////////////////////////////////////////////////////////////////////////